<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <input type="text" placeholder="员工姓名" id="i1">
    <input type="text" placeholder="员工工资" id="i2">
    <input type="text" placeholder="员工工作" id="i3">
    <input type="button" value="add" onclick="f()">

<table border="1">
    <caption>employee list </caption>
    <tr><th>name</th><th>salary</th><th>work</th></tr>
</table>
<script>
    let i1=document.querySelector("#i1")
    let i2=document.querySelector("#i2")
    let i3=document.querySelector("#i3")
    let table=document.querySelector("table")
    function f(){
        let tr = document.createElement("tr");
        let nameTd = document.createElement("td");
        let salaryTd = document.createElement("td");
        let jobTd = document.createElement("td");
        nameTd.innerText=i1.value;
        salaryTd.innerText=i2.value;
        jobTd.innerText=i3.value;
        //把 新增的三个td 装入tr
        tr.append(nameTd,salaryTd,jobTd);
        //把新增的tr装入已有的table
        table.append(tr);

        document.body.append()//只有document.body不需要查到到,可以直接使用

    }

</script>

</body>
</html>